1. Field of the Invention
The present invention relates generally to a method and system for binary-to-decimal conversion and vice versa. More specifically, the invention relates to a method and a system for converting between binary and decimal notations, and in particular, between 8-bit hexadecimal and decimal notations. The invention further relates to a method and system for binary-to-decimal conversion of data transmission codes representative of alphanumerical characters and the like into decimal digit sequences.
2. Description of the Prior Art
Binary codes, most often hexadecimal codes, are commonly used to represent alphanumeric characters and the like. In order to duplicate these hexadecimal codes in bar code using the two-out-of-five decimal notation system, the hexadecimal codes must first be converted to decimal notation.
Conventional binary-to-decimal conversion systems simply convert each 4-bit nibble of an 8-bit code from hexadecimal to decimal. For example, in JIS 8-bite codes, the Japanese katakana character ( ) is represented by hexadecimal code (DC)H, which would be converted into the sequence of decimal digits (220). Such decimal digit sequences are then converted into two-out-of-five bar-code, in which 2 lines from among 4 lines are thickened to represent "1" bits.
The JIS and ASCII 8-bit codes provide 256 combinations, each representing a specific character or command. But, among these combinations, the ranges (00)H to (1F)H and (80)H to (9F)H are used as control codes for controlling the operation of printers and other external devices. Therefore, these cannot be used to represent alphanumeric characters or the like.
On the other hand, when bar codes are used to label retail products such as video tape cassettes (VTR cassette), the aforementioned codes specifically reserved as control codes cannot be used. Therefore, when using bar codes for such purposes, it is not necessary to convert these control codes.
Therefore, the present invention is intended to provide a method and system for performing binary-to decimal conversion which ignores the aforementioned control codes and thus performs conversion more efficiently. Furthermore, the invention is intended to provide a method and a system for binary-to-decimal conversion in which a major attribute of each 8-bit value is encoded in a decimal digit which also represents the attributes of two other 8-bit values. This helps make the binary-to-decimal conversion even more efficient.